using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace SystemFunctionLib.Apis
{
    internal static partial class WinApis
    {
        public const uint WHEEL_PAGESCROLL = UINT_MAX;
    }

    internal enum SPI : uint
    {
        GetBeep = 0x0001,
        SetBeep = 0x0002,
        GetMouse = 0x0003,
        SetMouse = 0x0004,
        GetBorder = 0x0005,
        SetBorder = 0x0006,
        GetKeyboardSpeed = 0x000A,
        SetKeyboardSpeed = 0x000B,
        LangDriver = 0x000C,
        IconHorizontalSpacing = 0x000D,
        GetScreenSaverTimeOut = 0x000E,
        SetScreenSaverTimeOut = 0x000F,
        GetScreenSaverActive = 0x0010,
        SetScreenSaverActive = 0x0011,
        GetGridGranularity = 0x0012,
        SetGridGranularity = 0x0013,
        SetDeskWallpaper = 0x0014,
        SetDeskPattern = 0x0015,
        GetKeyboardDelay = 0x0016,
        SetKeyboardDelay = 0x0017,
        IconVerticalSpacing = 0x0018,
        GetIconTitleWrap = 0x0019,
        SetIconTitleWrap = 0x001A,
        GetMenuDropAlignment = 0x001B,
        SetMenuDropAlignment = 0x001C,
        SetDoubleClickWidth = 0x001D,
        SetDoubleClickHeight = 0x001E,
        GetIconTitleLogFont = 0x001F,
        SetDoubleClickTime = 0x0020,
        SetMouseButtonSwap = 0x0021,
        SetIconTitleLogFont = 0x0022,
        GetFastTaskSwitch = 0x0023,
        SetFastTaskSwitch = 0x0024,
        SetDragFullWindows = 0x0025,
        GetDragFullWindows = 0x0026,
        GetNonClientMetrics = 0x0029,
        SetNonClientMetrics = 0x002A,
        GetMinimizedMetrics = 0x002B,
        SetMinimizedMetrics = 0x002C,
        GetIconMetrics = 0x002D,
        SetIconMetrics = 0x002E,
        SetWorkArea = 0x002F,
        GetWorkArea = 0x0030,
        SetPenWindows = 0x0031,
        GetFilterKeys = 0x0032,
        SetFilterKeys = 0x0033,
        GetToggleKeys = 0x0034,
        SetToggleKeys = 0x0035,
        GetMouseKeys = 0x0036,
        SetMouseKeys = 0x0037,
        GetShowSounds = 0x0038,
        SetShowSounds = 0x0039,
        GetStickyKeys = 0x003A,
        SetStickyKeys = 0x003B,
        GetAccessTimeOut = 0x003C,
        SetAccessTimeOut = 0x003D,
        GetSerialKeys = 0x003E,
        SetSerialKeys = 0x003F,
        GetSOUNDSENTRY = 0x0040,
        SetSOUNDSENTRY = 0x0041,
        GetHighContrast = 0x0042,
        SetHighContrast = 0x0043,
        GetKeyboardPREF = 0x0044,
        SetKeyboardPREF = 0x0045,
        GetScreenReader = 0x0046,
        SetScreenReader = 0x0047,
        GetAnimation = 0x0048,
        SetAnimation = 0x0049,
        GetFontSmoothing = 0x004A,
        SetFontSmoothing = 0x004B,
        SetDragWidth = 0x004C,
        SetDragHeight = 0x004D,
        SetHandHeld = 0x004E,
        GetLOWPowerTimeOut = 0x004F,
        GetPowerOffTimeOut = 0x0050,
        SetLOWPowerTimeOut = 0x0051,
        SetPowerOffTimeOut = 0x0052,
        GetLOWPowerActive = 0x0053,
        GetPowerOffActive = 0x0054,
        SetLOWPowerActive = 0x0055,
        SetPowerOffActive = 0x0056,
        SetIcons = 0x0058,
        GetDefaultInputLang = 0x0059,
        SetDefaultInputLang = 0x005A,
        SetLangToggle = 0x005B,
        GetWindowsExtension = 0x005C,
        SetMouseTrails = 0x005D,
        GetMouseTrails = 0x005E,
        ScreenSaverRunning = 0x0061,
        GetSnapToDefButton = 0x005F,
        SetSnapToDefButton = 0x0060,
        GetMouseHoverWidth = 0x0062,
        SetMouseHoverWidth = 0x0063,
        GetMouseHoverHeight = 0x0064,
        SetMouseHoverHeight = 0x0065,
        GetMouseHoverTime = 0x0066,
        SetMouseHoverTime = 0x0067,
        GetWheelScrollLines = 0x0068,
        SetWheelScrollLines = 0x0069,
        GetMenuShowDelay = 0x006A,
        SetMenuShowDelay = 0x006B,
        GetWheelScrollChars = 0x006C,
        SetWheelScrollChars = 0x006D,
        GetShowImeUI = 0x006E,
        SetShowImeUI = 0x006F,
        GetMouseSpeed = 0x0070,
        SetMouseSpeed = 0x0071,
        GetScreenSaverRunning = 0x0072,
        GetDeskWallpaper = 0x0073,

        GetAudioDescription = 0x0074,
        SetAudioDescription = 0x0075,
        GetScreenSaverSecure = 0x0076,
        SetScreenSaverSecure = 0x0077,

        GetActiveWindowTracking = 0x1000,
        SetActiveWindowTracking = 0x1001,
        GetMenuAnimation = 0x1002,
        SetMenuAnimation = 0x1003,
        GetComboBoxAnimation = 0x1004,
        SetComboBoxAnimation = 0x1005,
        GetListBoxSmoothScrolling = 0x1006,
        SetListBoxSmoothScrolling = 0x1007,
        GetGRADIENTCAPTIONS = 0x1008,
        SetGRADIENTCAPTIONS = 0x1009,
        GetKeyboardCUES = 0x100A,
        SetKeyboardCUES = 0x100B,
        GetMenuUNDERLINES = GetKeyboardCUES,
        SetMenuUNDERLINES = SetKeyboardCUES,
        GetActiveWNDTRKZORDER = 0x100C,
        SetActiveWNDTRKZORDER = 0x100D,
        GetHotTracking = 0x100E,
        SetHotTracking = 0x100F,
        GetMenuFade = 0x1012,
        SetMenuFade = 0x1013,
        GetSelectionFade = 0x1014,
        SetSelectionFade = 0x1015,
        GetTooltipAnimation = 0x1016,
        SetTooltipAnimation = 0x1017,
        GetTooltipFade = 0x1018,
        SetTooltipFade = 0x1019,
        GetCURSORSHADOW = 0x101A,
        SetCURSORSHADOW = 0x101B,
        GetMouseSONAR = 0x101C,
        SetMouseSONAR = 0x101D,
        GetMouseClickLOCK = 0x101E,
        SetMouseClickLOCK = 0x101F,
        GetMouseVANISH = 0x1020,
        SetMouseVANISH = 0x1021,
        GetFlatMenu = 0x1022,
        SetFlatMenu = 0x1023,
        GetDropShadow = 0x1024,
        SetDropShadow = 0x1025,
        GetBLOCKSENDInputRESETS = 0x1026,
        SetBLOCKSENDInputRESETS = 0x1027,

        GetUIEffects = 0x103E,
        SetUIEffects = 0x103F,
        GETDISABLEOVERLAPPEDCONTENT = 0x1040,
        SETDISABLEOVERLAPPEDCONTENT = 0x1041,
        GETCLIENTAREANIMATION = 0x1042,
        SETCLIENTAREANIMATION = 0x1043,
        GetClearType = 0x1048,
        SetClearType = 0x1049,
        GETSPEECHRECOGNITION = 0x104A,
        SETSPEECHRECOGNITION = 0x104B,
        GetForegroundLOCKTimeOut = 0x2000,
        SetForegroundLOCKTimeOut = 0x2001,
        GetActiveWNDTRKTimeOut = 0x2002,
        SetActiveWNDTRKTimeOut = 0x2003,
        GetForegroundFLASHCOUNT = 0x2004,
        SetForegroundFLASHCOUNT = 0x2005,
        GetCARETWidth = 0x2006,
        SetCARETWidth = 0x2007,
        GetMouseClickLOCKTime = 0x2008,
        SetMouseClickLOCKTime = 0x2009,
        GetFontSmoothingType = 0x200A,
        SetFontSmoothingType = 0x200B,
        GetFontSmoothingContrast = 0x200C,
        SetFontSmoothingContrast = 0x200D,
        GetFocusBorderWidth = 0x200E,
        SetFocusBorderWidth = 0x200F,
        GetFocusBorderHeight = 0x2010,
        SetFocusBorderHeight = 0x2011,
        GetFontSmoothingOrientation = 0x2012,
        SetFontSmoothingOrientation = 0x2013,
    }

    internal enum SPIF : uint
    {
        None = 0x00,

        /// <summary>
        /// Writes the new system-wide parameter setting to the user profile.
        /// </summary>
        UpdateIniFile = 0x01,

        /// <summary>
        /// Broadcasts the WM_SETTINGCHANGE message after updating the user profile.
        /// </summary>
        SendChange = 0x02,

        /// <summary>
        /// Same as <see cref="SendChange"/>.
        /// </summary>
        SendWinIniChange = 0x02
    }

    /// <summary>
    /// ANIMATIONINFO specifies animation effects associated with user actions. 
    /// Used with SystemParametersInfo when SPI_GETANIMATION or SPI_SETANIMATION action is specified.
    /// </summary>
    /// <remark>
    /// The uiParam value must be set to (System.UInt32)Marshal.SizeOf(typeof(ANIMATIONINFO)) when using this structure.
    /// </remark>
    [StructLayout(LayoutKind.Sequential)]
    internal struct ANIMATIONINFO
    {
        /// <summary>
        /// Creates an AMINMATIONINFO structure.
        /// </summary>
        /// <param name="iMinAnimate">If non-zero and SPI_SETANIMATION is specified, enables minimize/restore animation.</param>
        public ANIMATIONINFO(int iMinAnimate)
        {
            this.cbSize = CoreApis.SizeOf(typeof(ANIMATIONINFO));
            this.iMinAnimate = iMinAnimate;
        }

        /// <summary>
        /// Always must be set to (System.UInt32)Marshal.SizeOf(typeof(ANIMATIONINFO)).
        /// </summary>
        public uint cbSize;

        /// <summary>
        /// If non-zero, minimize/restore animation is enabled, otherwise disabled.
        /// </summary>
        public int iMinAnimate;
    }

    internal enum FONTSMOOTHINGTYPE : uint
    {
        Standard = 0x0001,
        ClearType = 0x0002,
        Docking = 0x8000,
    }

    internal enum FONTSMOOTHINGORIENTATION : uint
    {
        Bgr = 0x0000,
        Rgb = 0x0001,
    }
}
